Smoothing surface geometry

Adding a Color Layer to a Surface

Here we add a colors to the surface that are a function of each surface node’s x coordinate. When then map these values to a rainbow color map.


white_surf1 <- smooth(white_surf, type="taubin", lambda=.9)
open3d()
#> glX 
#>   3
xvals <- white_surf1@mesh$vb[1,]
p <- plot(white_surf1, vals=xvals, cmap=rainbow(255))
rglwidget()

Showing an activation on a surface


white_surf1 <- smooth(white_surf, type="taubin", lambda=.9)

open3d()
#> glX 
#>   5
mfrow3d(1, 3, byrow = TRUE)
vals <- rnorm(length(nodes(white_surf1)))
surf <- NeuroSurface(white_surf1, indices=1:length(vals), data=vals)
ssurf <- smooth(smooth(surf))
p <- plot(ssurf@geometry, vals=ssurf@data, cmap=rainbow(100), irange=c(-2,2), thresh=c(-.2, .2))

next3d()
comp <- conn_comp(ssurf, threshold=c(-.2,.2))
vals <- ssurf@data
vals[comp$size@data < 5] <- 0
p2 <- plot(ssurf@geometry, vals=vals, cmap=rainbow(100), irange=c(-2,2), thresh=c(-.2, .2))

next3d()
csurf <- cluster_threshold(ssurf, size=33, threshold=c(-.2,.2))
p2 <- plot(csurf, cmap=rainbow(100), irange=c(-2,2), thresh=c(-.2, .2))
rglwidget()

Showing two hemisperes in same scene


open3d()
#> glX 
#>   7
white_surf1 <- smooth(white_surf, type="taubin", lambda=.5)

curv_lh <- curvature(white_surf1)
white_rh_surf1 <- smooth(white_rh_surf, type="taubin", lambda=.5)
curv_rh <- curvature(white_rh_surf1)

p <- plot(white_surf1, bgcol=curv_cols(curv_lh), viewpoint="posterior")
p <- plot(white_rh_surf1,bgcol=curv_cols(curv_rh), viewpoint="posterior")
rglwidget()